﻿<UserControl 
  x:Class="CrackNET.InjectedViewer.View.MemoryExplorer.BreadcrumbTrailView"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  >
  <GroupBox 
    Grid.Column="1" Grid.Row="1"
    Background="White"
    Header="Breadcrumb Trail"
    MinHeight="40"
    VerticalContentAlignment="Center"
    >
    <ItemsControl ItemsSource="{Binding Path=Breadcrumbs, Mode=OneWay}">
      <ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
          <WrapPanel Orientation="Horizontal" />
        </ItemsPanelTemplate>
      </ItemsControl.ItemsPanel>
      <ItemsControl.ItemTemplate>
        <DataTemplate>
          <TextBlock Margin="0,2,8,4" ToolTip="{Binding Path=BreadcrumbToolTipText, Mode=OneWay, IsAsync=True}">
            <Hyperlink x:Name="link" Click="OnHyperlinkClick" Style="{x:Null}">
              <TextBlock Text="{Binding Path=BreadcrumbDisplayName, Mode=OneWay, IsAsync=True}" />
            </Hyperlink>
            <TextBlock x:Name="arrows" Margin="2,0,0,0" Text=">>" />
          </TextBlock>
          <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding Path=CanNavigateBackToObject, Mode=OneTime}" Value="False">
              <Setter TargetName="link" Property="IsEnabled" Value="False" />
              <Setter TargetName="arrows" Property="Visibility" Value="Hidden" />
            </DataTrigger>
          </DataTemplate.Triggers>
        </DataTemplate>
      </ItemsControl.ItemTemplate>
    </ItemsControl>
  </GroupBox>
</UserControl>